package com.qianfeng.springbootquickstart.controller;

import com.qianfeng.springbootquickstart.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {


    private User user;

    @Autowired
    public void setUser(User user) {
        this.user = user;
    }

    @RequestMapping("/test1")
    public String test1(){
        return "我问吴亦凡要充电器,她居然说我凶她";
    }

    @RequestMapping("/test2")
    public String test2() {
        return user.getName() + user.getPassword();
    }

}
